import cn.kgc.dtos.Dto;
import cn.kgc.pojo.ItripUser;
import cn.kgc.service.ItripUserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ceshi {


    @Test
    public void ceshi(){
        ApplicationContext pc = new ClassPathXmlApplicationContext("spring.xml");
        ItripUserService user=  pc.getBean(ItripUserService.class);
        ItripUser j=new ItripUser();
        j.setUserCode("2408362769@qq.com");
        j.setUserPassword("1234");
        j.setUserName("dw1");
        Dto dto= user.register(j);
        System.out.println(dto.getSuccess());
    }


    @Test
    public  void hhhh(){
        ApplicationContext pc = new ClassPathXmlApplicationContext("spring.xml");
        ItripUserService user=  pc.getBean(ItripUserService.class);
         Dto dto=user.login("15384019313","1234","pc");
        System.out.println(dto.getSuccess()+"\n"+dto.getData());

    }
}
